fix bugs in sms