db bug fix