Added callback to connect method