updated templates to ensure error pages work properly.