Improve sms error handling