added logs to connect()