correct file permissions and ownership