if you want it to stop on a partial match, just add && i==0 to this condition