adding function for merging nested dicts