bug fixes in smshandler