Fix bugs on mPOrder

added function checkIfTheSame