Updated restart function