Added animations logic for states.