Optimize and fix player teleport event