fixed delete functionality