correct some logic error for undo and update summary report