database model fix and predicate