added the right way to exit.