Changed logging to printing stacktraces