Added teleport command and fixed thread-safety problem