fixing json creation issues