Correcting page calculation