added page preprocessing