refactor throw out error when fail to init conn