fix for undefined value json parse error