Fixing saveJson method