Fix flicker frame bug on transition end