Fixed bug in UpdateDbThread.