Fix shared permission bug