fixing header mode behavior on scroll