check error before access returned list