Add

add a function for automatic restart