permissions bug fix