proper connection closed handling