write working for large files