using wrong loop function