bug fix, infinite loop when synchronous layout in transitionend callback