add animation for switching