Fixed issue where table view was not dismissed when the cancel button is clicked