fixed the task to log errors