handle permissions