fix bug with db make db singleton