proper exit-code handling