catch various errors