enhancing connection handling