Assuming you use
biblatex you can use the
heading=bibintoc option for
printbibliography to include the bibliography in the table of contents. By using this option, you do not need to redefine the
bibname and also the
addcontentsline command is not required.
Here is working minimal example:
Edit: The reason for the incorrect page number is that
printbibliography outputs the heading (on page IV) as well as the content for the bibliography (filling page IV to VI) and
- then the
addcontentsline creates the entry for the table of contents (at this point the page number is VI)
You would have to insert the
addcontentsline directly after the heading of the bibliography and before the content of the bibliography is printed. The option
heading=bibintoc does that for you.