check connection only once per call