permission bug fix