fix bug for typeahead