Limited the scope of the jquery selectors to the first match in the array

Limited the scope of the jquery selectors to the first match in the array