added send event code