modified json encode