Animation flash problem solved