Fix the flickering animation on first page load