fix a bug of database