Fix scroll function