fix animation transition flashing