added more logging for exceptions