check connection before running control