replaced raw with html_safe someplaces