I removed href="#" from the links which caused the page to scroll up.