count detection works