Fixed permissions bug