fix bug in remote query engine