fixed undeleting of deleted elements