change method of handling json array.