fixed some bugs with NSArray and NSDictionary