Fixed bug that prevented auto restart