getPathStateFromNode now working correctly