fix render page logic