added index for @class
improved permissions script