Added helper method to fix issues around HTML tags not being closed