fixed bug in CM model