fix a bug in search where I accidentally use a dict instead of list