change animation into state