Correct obvious mistake in  array check