Fix crash due to reordered subscriptions when subscribing/retracting

The problem persits when adding/removing roles
rework some minor issues