changed the if statement to prevent unnecessary downloads