fixed a bug where getpage where called twice.