catch errors better