pages logic modified