correcting error logging