Fix with closing channels and leaving