Added a check for proper response data