Touchscreen bug fix for closing modals