re change to afterHtml function