added a control to check if the query's response is empty