database model fixed