Fixed remove permission bug