Finally updated up/down arrow history to support all modes bug-free