move execution of instance download further down. kept the funtion