make process exit cleanly