halt with correct exit code