made scrolling-to-top gets detected before searching for the target DOM element

This change makes broken scroll-to link to be ignored instead of scrolling to top