converting to string to avoid objects that not respond to html_safe