Bugfix spawn player function