fixed overwrite bug