fixed bug in MM