Added download logic