fixed counting of waiting items