Fixed delete functionality