switched order of calling setPosition