remove extra [] in a dictionary if needed