undo reset bug fix, it introduces a worse bug