Fix to wave animation loop bug