I fixed JSON generation, but now it gives some error in the unpack function.