better check for array in segments