Make restart more reliable