Fixed problem with it not exiting