Fix position flicker after an animation ends