fixed bugs with connectivity