implement some code for player change