add animation logic