fix bugs in dict in element.py