add element
fixed a bug