fix animation fail at first time on firefox