fixed problem in process exit code handling