Throws exception when text contains <BR>.
Fix by andrewkolesnikov
Add callback function