fixed auto-updating of counts.  better use of directives