fix word offset bug