handle process exit better.