double deletion bug fix