added logging of errors