This is a better fix than e38c7f03d4cc756529efabaaf5eae9433b659359. It handles esc and survives a refresh.
Wiring up 404 and 500.