 			if peer = @getPeer(id)
 				@setParent(peer)
 			else
-				peer = @connect(id, ( ) =>
-					@setParent(peer)
+				peer = @connect(id, ( success ) =>
+					if success
+						@setParent(peer)
 				)
 
 		# Adds a token to the collection of foreign tokens

			if @isSuperNode
				callback?(false)
				return
			console.log 'sending parent request to ' + peer.id
			peer.query('peer.requestAdoption', @id, (accepted) =>
				unless accepted?
					callback?(false)
				if accepted and not @isSuperNode
					console.log 'parent request accepted'
					if @_parent?

		_onPeerSetSuperNode: ( id, superNode ) =>
			unless peer = @getPeer(id)
				if superNode and @isSuperNode
					peer = @connect(id, ( success ) =>
						if success
							@addSibling(peer)
					)
			else peer.isSuperNode = superNode

