added record counting