Fix permissions getting cleared when updating