Fix the deleting bug