autocomplete logic change