improving pages controller behaviour