fix dict insertion