init connection after view is ready