fixed problem with array by converting to hash