fix completion selection with arrow keys