Added logic for page and comments.