fix 500 response code on error pages