fixed db bug