improvements to autocomplete