Remove bug with dictionary updating