set correct exit status on failure