add connection check