fixing the 'delbutton' functionality