Updated check for array key