remove keys and sys.exit on deletion