Fix for memory-leak in typeahead