fixing infinite loop on animator