add correct handling of HTML entities