Made insert exit if the element already exists in the array.