check exit status as well