scope fix for events