fix the error if a tuple to be updated or deleted has already been updated or deleted by a BEFORE trigger
changed cms function to match old version of the where clause