Fixed bug in printing json