- fixed a bug in deleteElement method