Fix Document empty page bug