fixed JSON output and topic printing