updated animation mechanism so it works when others render in-line