A* freezes unity

I’m trying to learn about pathfinding, right now I’m getting unity freezed at second iteration. Here’s the part which freezes (it goes fine at the first time) so if you can’t spot any problems in this function I’ll post some more, maybe problem is somewhere else.

private Node GetByPosition(Vector3 pos, Dictionary<int, Node> d){
		Node m = null ;
		print("checking");
		foreach(KeyValuePair<int, Node> n in d){
			if(n.Value.position == pos){
				m = n.Value;
			}
		}
		
		if(m == null)
			print ("No Node in dict");
		
		
		return m;
	}

Are you going into an infinite Loop? Debug your program to see why.

Set Breakpoints in MonoDevelop and Run-Menu → AttachToProcess