Added missing sync block in self.connect