added switch to toggle auto-scrolling