Create shutdownhook before stating restart threads