Added a possibility to throw an exception on isConnect