Fix error when manage permission on device.