added automatic restart option