Added status code checking.