adding before filter for pages