bug fix with db