Fix the transition bug