minor change to error catching in MM_functions