fix the loop call