check exit code