add dynamic query distribution to enginehandler