fix read/write permissions on files