adjust animation logic