Changed the way the DB thread processing is done.
Cleaning up MainWindow