fix database model