cleaned up js for modals