Fixing permission returning 1