fixing delete func