added empty response check