remove use of to_err_msg()