Fixed crashing bug related to teleporting