fix for null byte causing error in SendMessage