correct exitcode exception handling