fixed some causes for crashs;
also clients actually disconnect now