Add error handling if there is no response object