fix js bug with smooth scrolling to anchors