fix delete func