catch errors a bit better