fixes to animation bug