Fix the array check