updates data and adhoc queries