restart command, improving error handling