fixed logging to show stack traces