delete function workded