fixed a database bug