Fix permission granting