Fixed multiple connections bugs