Improved permission setting