add typeahead logic