added possibility to render legend on a second page