fix attribute error on accessing response.body