updated nested keys method to call objectAtIndex when it encounters an NSArray