make initial connection handle connection error and reconnects with original params
Merge pull request #47 from jimhorng/feature/fix_init_conn

make initial connection handle connection error and reconnect with origin parameters