Hide modal when trigger element is removed during an ajax request