error logging corrected