Fix transitioning bug