catches more errors and more generic then before