connection handling fix