improve the transition animation