fixed sticky-header to not rely on global function and implement page exit / plugin teardown