bug fix in tofrom json