fixed getWords bug