Finish delete function