rewrite player state detact