moved the htmlString var inside the callback