Make it work with events