fixed error in detecting server