Added debug to Connect method