fix segfault when detaching and re-attaching a player