Added in a check for more than one exit.