fixing "Error: null" on teleport