Added write to JSon method