Json bug fix

address #246