fixed typeahead functionality