Fixed teleport function