add counters
extract making tmpdirs