update query and add reset query cache