Added in sys.exit due to a hang in termination