fixed maint script to include aggregates