update countAll method