fix order of definition
escape html with updatedPages and newPages