change sendMessage method