Updated delete code