# List of problem title same style as list of figures title?

I have custom made list of problems, and list of figures generated by tocloft. I want the two list titles to be of the same style.

I looked into source of tocloft.sty and added a new command there:

\newcommand{\@loptitle}{%
\if@cfthaschapter
\vspace*{\cftbeforeloftitleskip}
\else
\vspace{\cftbeforeloftitleskip}
\fi
\@cftpagestyle
{\interlinepenalty\@M
{\cftloftitlefont\listproblemname}{\cftafterloftitle}
\cftmarklof
\par\nobreak
\vskip \cftafterloftitleskip


(based on \@cftmakeloftitle) It doesn't work -- during compilation I get

! Undefined control sequence.
l.45 \loptitle


I'm sure I have \usepackage{tocloft} before I call \loptitle.

I guess my mistake is that it's not enough to usepackage to load it all.

-

\vspace*{\cftbeforeloftitleskip}