fix const-correctness bug