redone changes in serverthread