Wrong variable was logged.

err does not exist. Fixed.