Added status code checks