updated to use html_writer for rendering html