Added exit function, removing auto exit.