updating plugin to count correctly per class