metrics and error checks