Modified the code for Redo method.