Delete function modofied