fix overwrite bug