Added a logger for errors