finshes the looping