fixed deleteInstance