fix max restart (TSUN-252)