There are a number of safeguards that are usually taken to prevent this sort of accident happening. Railroads have strict government-approved procedures for testing the air brake systems when making up trains in a yard or picking up cars en route. These generally involve connecting the air brake hoses, charging up the brake system, setting the brakes and manually inspecting the cars to ensure the brakes are applied, and then releasing the brakes and manually inspecting the cars to ensure the brakes are released. Particular attention is usually paid to the rearmost car of the train, either by manual inspection or via an automated end-of-train device, to ensure that brake pipe continuity exists throughout the entire train. When brake pipe continuity exists throughout the train, failure of the brakes to apply or release on one or more cars is an indication that the cars' triple valves are malfunctioning. Depending on the location of the air test, the repair facilities available, and regulations governing the number of inoperative brakes permitted in a train, the car may be set out for repair or taken to the next terminal where it can be repaired.