Fixed download logic