Added logging statements for for exceptions