Adding undo and counter to replay mode.