deleteElement now returns value