added key events for autocomplete