Error while running dynare in loops

I am running my dynare code for different parameter values. The second iteration always gives me the following error:

“The Jacobian matrix evaluated at the steady state contains elements that are not real or are infinite”

I suspect the problem is coming from “clear” option while running the code. I am running with “noclearall” so that dynare doesn’t delete the parameter sets outside the loop. Individually, the code runs fine for all the parameter values, so it is not coming from badly specified steady states. Any help or hint will be great.

Without the code it is hard to tell.