reorder error display to avoid race conditions