Exits program if a stage fails