added connection tests + fixes