fixed a minor glitch when the last undo state is reached