Improve permission setting