fd bug fixed and test for server improved