fix exception for non-zero exit code in script