fixes to autocomplete feature