change the i/o stream to using JSON format
add index count