Bugfix with page index