replace counter in sms procedure