Improve error handling not to panic

Improve error handling not to make new instance of response.