correct page calculation