added permissions removal, and fixed update method