changed cms function to match old version of the where clause