fix flash to end animation