modify ERR to printf