Update state! for a cellstate

Hi, I am trying to panelize a cell state and then use it in a update state function in gridap but it gives me error. I appreciate your suggestions.

innerMax = 10
p0 = ones(fem_params.np)
pf_vec = Filter(p0;r, fem_params)
pfh = FEFunction(fem_params.Pf, pf_vec)
pth = (pf -> Threshold(pf; β, η)) ∘ pfh
sPrev = CellState(1.0,dΩ)
sh = project(sPrev ,model,dΩ,order)
ψPlusPrev = ((p->Em(p))∘pth) * CellState(0.0,dΩ)
for  inner = 1: innerMax
        ψhPlusPrev = project(ψPlusPrev ,model ,dΩ,order)
        RelErr = abs(sum(∫( Gc*ls*∇(sh)⋅∇(sh) + 2*ψhPlusPrev*sh*sh + (Gc/ls)*sh*sh)*dΩ-∫( (Gc/ls)*sh)*dΩ))/abs(sum(∫( (Gc/ls)*sh)*dΩ))
        sh_vec = stepPhaseField(fem_params,uh,ψhPlusPrev)
        sh = FEFunction(fem_params.U_PF, sh_vec)
        u_vec = stepDisp(fem_params,pth, uh, sh)
        uh = FEFunction(fem_params.U0_Disp, u_vec)
        ψhPos_in = ((p->Em(p))∘pth) * (ψPos∘(ε(uh)))
        update_state!( new_EnergyState ,ψPlusPrev ,ψhPos_in)
        if   RelErr  < 1e-8

writevtk(Ω,"resultstph",cellfields=["uh"=>uh, "sh"=>sh])

the error is


At least one CellState object has to be given to the update_state! function

 [1] update_state!(::Function, ::Gridap.CellData.OperationCellField{ReferenceDomain}, ::Vararg{Gridap.CellData.OperationCellField{ReferenceDomain}})
   @ Gridap.CellData C:\Users\marya\.julia\packages\Gridap\971dU\src\CellData\CellStates.jl:81
 [2] top-level scope
   @ In[26]:19

It seems that multiplication of ((p->Em(p))∘pth) with a cell state cause the problem but i dont know how to solve it.

If you provide a minimal working example, you can make it easier for others to help.

I suggest also including the using and import statements so we just take the MWE, run it, and reproduce the issue.