addded counter for mms. May break it (I don't know ruby)