Added break to avoid unnecessary looping if a match is found