fix <error has occured> after sys.exit