added utility function to merge dicts