fixed animation logic