Updated scroll logic