Just don't jump into any thread and have your query. I have moved it as a separate thread for you this time.