fix count node & cleanup