fix setting permissions