Fix the bugs of deleting