Catch errors while setting permissions