added basic logging for exceptions