check exit status