change dictionary var in function