better exit code handling