proper index checking for TArray's