Added error log for sendMessage