modals loop fixed