give permission bug fix