remove const from errstr