check for position is in array