log errors better