Add dispatch queue to synchronize database access