fixing JSON errors