fix stderr reading