fixed directory permissions bug introduced when moving from permissions to dirpermissions