fixed checking index in an array dataset