updated print helper to show both stdout and stderr