Fix deletion bug