added 'mode' param for query_update