Added logging of all errors