fixed bug of permission setting