This looks like a duplicate of that in the start() function. Given that both are called from sidebar.html, that doesn't seem too efficient.