The categorical imperative can only be based on something that is an "end in itself", that is, an end that is not a means to some other need, desire, or purpose.
The categorical imperative, however, may be based only on something that is an "end in itself". That is, an end that is a means only to itself and not to some other need, desire, or purpose.