refactored to match gotako, made error pages output something