Add restart code (thanks to Sylvain ;-)