fix an overwrite bug