removed ThreadLocal for Query to fix leaks