fixed a bug in Element util