Fixing database model