new version with events