update dict function