Added flag to set whether to dispatch events to all scopes or to the last one in the scopes path