Changed method toJSON to stringify in partition