Fixed updatePosition() so that it uses proper Node.js function