fix word extraction bug