better connection handling support