remove redundant error checks