need to fix some error handling a little more, response object is getting freed before it is referenced in the catch