fixed bug that could cause an endless loop (freeze) in the MM engine