fix problems with readonly files