fixed some crashes in multiplayer