recode modal js to work on any of the modals