Cut off search if len goes to 0