Add a check to prevent white pages