add animation when doing transiton between states