changed quit to sys.exit