bug fix for delete