Added callback on close, support for html messages