fix restart code