Axiom. A class is a set if and only if it belongs to some (other) class
Comprehension schema. If $\varphi(x_1,\ldots,x_n)$ is a formula where quantification just occurs on sets variables, there exists a class $A$ such that $$(x_1,\ldots,x_n)\in A\text{ if and only if }\varphi(x_1,\ldots,x_n).$$
Definition. A category $\mathcal{C}$ is called a small category when its class $\text{Ob}(\mathcal{C})$ of objects is a set.
I am trying to use the above to show that $\text{Ob}($Cat$):=\{\mathcal{C}\ |\ (\exists X)(\text{Ob}(\mathcal{C})\in X)\}$ is a class: in other words, that the collection of all small categories is a class. I can't apply the comprehension schema because in the formula $$(\exists X)(\text{Ob}(\mathcal{C})\in X)$$ $X$ is quantified over and is not a set.
Where is my error?
Edit:
Do I even need to use comprehension to assert that $\{\mathcal{C}\ |\ (\exists X)(\text{Ob}(\mathcal{C})\in X)\}$ is a class?