replicated code (same function in liveblog.js)