eliminated overwrite bug