some changes to sendEvent