Don't bother writing out a page if it doesn't need it. This may be a stupid way of checking that, but hey.
Might help to use the correct variable. I mean, maybe.