Fixes #215

Add cleanup to stop polling when user leaves the page.