improved delete functionality