fix setPosition() error

Here is the pull request we talked about. I hope it is done good, this is the second pull request I do.