fix for counter problem