remove element properly