updated autocomplete.js to support seeting the key on click