update word counter