Added onSearch function. Ref #22