fixed a bug that corrupts the database