Dictionary doesn't work properly