fix npe if no connections