clean up looping mess