page entry logic