class library: animate method now sets state correctly