moved to bottom of loop