Implemented the delegate method to call the segue manually.