fix permission denied errors