Fix flickering issue in Safari on modal open.
Make close button in a separate method to clean things up a bit.
Flickering issue in Safari.