Added option to json serialization