fixed error thrown if first search() callback returns []