     end
   end
 
-  defp download_file(url) do
-    filename = :filename.join("/tmp", :filename.basename(url))
+  defp download_file(url, version) do
+    filename = :filename.join("/tmp", version <> :filename.basename(url))
     case File.exists?(filename) do
       true ->
         filename

    info = Poison.decode!(File.read!("agent.json"))
    arch = map_arch(:erlang.system_info(:system_architecture))
    arch_config = info["triples"][arch]

    System.put_env("LIB_DIR", priv_dir())



      File.mkdir_p!(priv_dir())

      download_file(arch_config["download_url"], version)
      |> verify_checksum(arch_config["checksum"])
      |> extract
    else
