improved method for control the timeout connections