dict.get method acts correctly