refactoring, hide stderr except in nonzero return.