Fix double deletion bug