Move Dialog aborted check to gui code