fixed rmElem method