fix memory leak in json deserializer