fixed a db bug