fix establish connection and namespaces