fixed getDb bug