Count method uses a cursor now