Fixes crashing bug where we check headers without first checking if the request was successful