$.inArray was not working as expected when testing for object equality. Have replaced with a grep method that compares elements code and label properties to deteemine equality.