added scrollToElement function