changed scroll function