a little bit of logic on pages