Removed \end{document} at the end.
Successfully merged the chapters into one document.