handling stderr and empty out; refs #4