Bugfix for index out of range error in multipage