Fixing permission checks