fix bug when performing multiple redos