Hacking to get the output to file for json