moved fixing permission to be the first cmd