fix bug when there is no parameter declared in the model

(cherry picked from commit fa7d123ea4ca5467e4c588046202eff280aa29c7)