Add error handler that prints stack trace