fix up loop