Fixed deletion bug