Working on better connection and disconnect handling