fixing array search