add missing awaitTermination call to database build threaded code.