fix err logging