added writing of errors to the Console