fix json encoding
more comments