Use $.each for loading instead of for