alter error logic