adapted plugin to work with pdftoc plugin