write back to original file