fixed b db bugs