fixing and code improvements in html pub/sub