Added support for multiple pages