updated grouped search to accommodate for malformed results