added stack trace printing.