added debug on connect