fix logic of machec event and implement for sending e-mail.