Remove infiniate while loop in typeahead_parse