Bug inArray returns -1 if it is not in array