Added JS to ensure position is correct when closing the modal.