Fix missing $this in connect method