Cannot run NPT following NVT simulation

Hi all,

I'm making a simple script to run NVT and NPT subsequently.

The script keeps making a problem is as follows

my \$nvt = \$module->Dynamics->Run(\$doc, ([         Ensemble3D => "NVT",

                            NumberOfSteps => \$numberStepsRAMP,

                            Temperature => 500,

                            TrajectoryFrequency => \$trajFrequency

                         ]));

my \$traj = \$nvt->Trajectory->EndFrame;

my \$trj = \$module->Dynamics->Run(\$traj, ([    Ensemble3D => "NPT",

                                NumberOfSteps => \$numberStepsRAMP,

                                Pressure => "0.0001",

                                Temperature => 500,

                                TrajectoryFrequency => \$trajFrequency

                            ]));

Upon the run, MS gives me the following error

Could not convert parameter "input" (index 0) from passed-in type 0 to expected type 9 (function/property "Run", parameter 2) at -e line 67.

67 is  my \$trj = \$module->Dynamics->Run(\$traj, ([    Ensemble3D => "NPT",

Would please advise me?

Jay