moved code to set changed player name to separate function