stop search when we reach l.max in localize_ia