moved to aggregate() for login count