daemon restart better error check