edit sendMessage method