added proper support for events