added distinction between listening to events globally or locally