added support for an empty first page