fixed exitcode in the error case