fix segfault according to a race condition during an animation run