Fixed bug: remove READ_ONLY attribute when overwriting files