Use closure and fix issue with mixed page/pages.