Fixed problem with Javascript references in ajax loaded modals