making permissions calls more robust