add some hooks and reinforce reset permissions mecanism