separate code to mute stderr printing