fix a bug in getword()