catch errors on fetching doc