fix calculate pos