moved out of the loop