Fix flickering animation