fixing loop content