fixing logic in manager startup and handling incoming connections