add some code for MM