fixed a bug when getting the path from a constraint