more changes to try to get SQLQueries running in thread form properly