fix pb with dictionary changing size