I'm using the format of a journal for submitting a paper. However, I have a problem with the numbering of subsections. In fact, in my output, the first section ends with subsection 1.3 and Section 2 starts with subsection 2.4, instead of the correct numbering 2.1. Similarly, definitions, theorems and propositions have a wrong numbering. In fact, section 2 ends with definition 2.3 and section 3 starts with definition 3.4.
Here is the part of code that I believe is involved in the wrong numbering of the subsections.
\newcommand*\chaptermark[1]{}
\setcounter{secnumdepth}{2}
\newcounter {part}
\newcounter {chapter}
\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]
\renewcommand \thepart {\@Roman\c@part}
\renewcommand \thechapter {\@arabic\c@chapter}
\renewcommand \thesection {\@arabic\c@section}
\renewcommand\thesubsection {\thesection.\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection}
\renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph}
\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
\newcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries}}
\def\section{\@startsection{section}{1}%
\z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
{\normalfont\bfseries\centering}}
\renewcommand\section[1]{\addtocounter{section}{1}
\medskip
\begin{center}
{\bf\thesection.\ \MakeUppercase{#1}}
\end{center}
\medskip
}
\newcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\large\bfseries}}
I also tried to find the setcounter relative to definition and theorem environments, but in the given template there is nothing similar. How can I solve this problem?
MWE
showing the problem