Add check for newline characters in JSON strings