fixed faulty recursive overwrite method