move animation update to the right place