Fixes #2 - checks for null anchor before scrolling