exit with correct exit code after success