added logging errors in a text file