more checks for malformed json