Problem Solved! I managed to fix it by commenting all the lines in the JPSPath and the problem went away.
I just called it like the game engine does, this.MoveFormationToTargetAttackRange i just need to find the right code and change it to appropriate ones.
Its all with the help of engine that i got it working.
Ill see how it goes
Thanks Stan