# PDF Bookmark hierarchy incorrect

I'm having the same problem as that noted in This question: namely, the pdf bookmarks are incorrect, with some sections incorrectly subsumed under others. However, the code that I'm using is somewhat different, so I'm not sure if the same solution applies. The appearance in the actual document is exactly as I'd like it to be, but I'd like the bookmarks to be correct as well.

Below is a MWE. The problem is presumably due to the addcontentsline.

\documentclass{book}
\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}

\tableofcontents
\chapter{First}

\section{introduction}

\blindtext

\newpage
\vspace*{\fill}

{
\Huge
\begin{center}  \textbf{APPENDICES}
\end{center}
}
\vspace*{\fill}
\newpage
test
\subsection*{Appendix A}
\blindtext

\subsection*{Appendix B}
\blindtext
\chapter{Second}

\section{Introduction}

\blindtext

\end{document}

• Probably the missing \phantomsection causes this error – user31729 Aug 15 '14 at 16:40

Manual additions to the ToC should be accompanied with \phantomsection before the sectioning command is issued, when used in conjunction with hyperref package.

\documentclass{book}
\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}

\tableofcontents
\chapter{First}

\section{Introduction}

\blindtext

\newpage
\vspace*{\fill}

{
\phantomsection
\Huge
\begin{center}  \textbf{APPENDICES}
\end{center}
}
\vspace*{\fill}
\newpage
test
\phantomsection
\subsection*{Appendix A}
\blindtext

\phantomsection
\subsection*{Appendix B}