fix for count variable