added tests and allow_no_connect option