fixing issues in the db