a little utility to count number of failed tasks