Modify updateQueryData to support debugging mode