added getWord() method, added lock invocation