fix deletion bug