restart function fixed