solve bug with player id being set to -1