small change in permission loop