quick fix end operation of for loop