minor bug fix on json gen