added support for custom error pages