fixed restart function