bug fix in sending events