now logging errors when they happen.