Fix bug in search function: do not cache old search result elements