Added update function to rebuild permissions