fix deletion of old variable