added a restart function