fix json encoding issue