Fix 500 error and update 404 page