fixes to the json method