modified model/database logic