fixed convert counter logic