Changed the logic for shouldPerformSegue