updated the query