Modal helper: bind on hidden event to the modal window