add missing error checks