Protect flows with a mutex
Handle error of main before Start