added --restart feature