fixed counter problem