Fix restart func
Add errors handlers