added debug for connect