make onEvent compatible with wamp v1 and v2