Fix error when json option is supplied