check key before reading the array