Use the non deprecated countEntities method