Added some conditional checks to prevent unneccassary failure/downloads