Adding some robustness for dealing with statusCode