fix page logic