Got automatic connection management working