Clean pagestate during preprocess.