changed JS so modals are re-usable