bug fix when server crashed and last string was short
cleaned up comments