Prepare before pages