fixed compilation
corrected m.extension logic