implemented shutdown and restart of braind