fixed potential memory leak when JSON serializing of static arrays