add multi-thread access to database