buggy delete functionality