allow custom events as constructor argument