fix bug on rendering pages