using block to access stdout