fail if not connected
refactoring