make sure activitiesBy doesn't grow indefinitely