added try/catch around .connected call