Corrected jsonutil to flush write