fix smooth scrolling to validate that target element exists.