Modified to be compatible with CMSMS 2.x