fix bug , change exit() to sys.exit