Do not jump into any thread with your query and I have moved your query into a separate thread.