Added function sendMessage and crud events