fixing boundary condition on unvareXpath()