Fix double deletion issue