updated json writer